<html>

<head>
  <script src="../js/jquery.min.js"></script>
</head>

<body>
  <div id="btn">
    点我
  </div>
  <script>
    a = 10;
    b = 20;
    if (a == b) {
      $("#btn").click(function() {
        console.log(1);
      });
    }
  </script>

</body>

</html>
